package com.flying.ouyu.base;

import java.util.ArrayList;

import com.flying.ouyu.R;
import com.flying.ouyu.controller.ControllerManager;
import com.flying.ouyu.controller.IObserver;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

public class BaseActivity extends Activity{
	
	protected ArrayList<IObserver> observerList = new ArrayList<IObserver>();
	
    public void onCreate(Bundle savedInstanceState,int resourceId) {
        super.onCreate(savedInstanceState);
        setContentView(resourceId);
        
        this.overridePendingTransition(R.anim.activity_in,R.anim.activity_out);
    }
    
    @Override
    public void onDestroy()
    {
    	//清除所有观察者
    	ControllerManager.getInstance().clearObserver(observerList);
    	
    	super.onDestroy();
    }
    
    protected View.OnClickListener goBackClick = new View.OnClickListener() {
		
		public void onClick(View v) {
			BaseActivity.this.finish();
		}
	};
}
